package top3.Marriages;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

public class MarriagesGroupingComparator extends WritableComparator {
    protected MarriagesGroupingComparator(){
        super(MarriagesTop3Bean.class,true);
    }
    @Override
    public int compare(WritableComparable a, WritableComparable b) {
        MarriagesTop3Bean aBean = (MarriagesTop3Bean) a;
        MarriagesTop3Bean bBean = (MarriagesTop3Bean) b;
        return aBean.getYears().compareTo(bBean.getYears());
    }
}
